package com.yanmaohu.yulia.statement;

import com.yanmaohu.yulia.bean.GranteeList;
import com.yanmaohu.yulia.bean.Grantor;
import com.yanmaohu.yulia.bean.Privileges;

/**
 * @author Bright Lee
 */
public final class GrantPrivilegeStatement implements GrantStatement {

    private int beginIndex;
    private int endIndex;
    private Privileges privileges;
    private GranteeList granteeList;
    private boolean withHierarchyOption;
    private boolean withGrantOption;
    private Grantor grantor;

    public GrantPrivilegeStatement(int beginIndex,
                                   int endIndex,
                                   Privileges privileges,
                                   GranteeList granteeList,
                                   boolean withHierarchyOption,
                                   boolean withGrantOption,
                                   Grantor grantor) {
        this.beginIndex = beginIndex;
        this.endIndex = endIndex;
        this.privileges = privileges;
        this.granteeList = granteeList;
        this.withHierarchyOption = withHierarchyOption;
        this.withGrantOption = withGrantOption;
        this.grantor = grantor;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public Privileges getPrivileges() {
        return privileges;
    }

    public GranteeList getGranteeList() {
        return granteeList;
    }

    public boolean isWithHierarchyOption() {
        return withHierarchyOption;
    }

    public boolean isWithGrantOption() {
        return withGrantOption;
    }

    public Grantor getGrantor() {
        return grantor;
    }

}
